package cn.maihe.elg.operation.model.enums;

import java.util.Arrays;

/**
 * @Description 附件类型
 * @Author WJH
 * @Date 2021/04/27
 */
public enum AttachmentFileType {
    //附件类型 0完整ofd文件  1电子保函申请单 2企业资质文件 3企业营业执照文件 4基本户开户证明文件
    // 5支付凭证 6到账证明 7电子保函pdf文件 8发票 9其他文件
    TYPE_0(0, "电子保函ofd文件"),
    TYPE_1(1, "法定代表人证明书或授权委托证明书或身份证复印件"),
    TYPE_2(2, "企业资质文件"),
    TYPE_3(3, "企业营业执照文件"),
    TYPE_4(4, "基本户开户证明文件"),
    TYPE_5(5, "转账凭证"),
    TYPE_6(6, "到账证明"),
    TYPE_7(7, "电子保函单文件"),
    TYPE_8(8, "发票"),
    TYPE_9(9, "其他文件"),
    TYPE_10(10, "招标文件"),
    TYPE_11(11, "电子保函申请书(已签署)"),
    TYPE_12(12, "电子保函申请书(待签署)"),
    TYPE_13(13, "保函申请承诺书(可选)"),
    TYPE_14(14, "结构化xml文件"),
    TYPE_15(15, "电子保函申请书(已签署)edc"),

    TYPE_16(16, "冲红发票"),
    TYPE_17(17,"理赔结果材料"),
    ;

    private int type;
    private String desc;

    AttachmentFileType(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public int getType() {
        return type;
    }
    public String getTypeStr(){
        return String.valueOf(type);
    }
    public String getDesc() {
        return desc;
    }

    public static AttachmentFileType resolve(int type) {
        return Arrays.stream(values()).filter(o -> o.type == type).findFirst().orElse(null);
    }
}
